package com.tianquan.PaginationPlugin;
/**
 * @author starsea
 * @date 2024-09-10 下午3:10
 */

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.tianquan.mapper.DishMapper;
import com.tianquan.mybatis.Dish;
import com.tianquan.spring.A;
import lombok.RequiredArgsConstructor;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: uploaddemo
 * @BelongsPackage: com.tianquan.controller
 * @Author: tianquan
 * @CreateTime: 2024-09-10  15:10
 * @Description: 测试
 * @Version: 1.0
 */

@RequiredArgsConstructor
@RestController
public class pageController {

    private final DishMapper dishMapper;

    @GetMapping("/page")
    @Transactional
    public void test2() {
        PageUtil<Dish> dishPageUtil = new PageUtil<>();

        dishPageUtil.startPage(1,10);

        dishMapper.list();

        PageInfo<Dish> pageInfo = dishPageUtil.getPageInfo();

        System.out.println((pageInfo.getList()));



    }



}
